%% FIGURE 2
clear all
clc
% Add path 
% Determine where your m-file's folder is.
folder = fileparts(which("Figure_2.m")); 
% Add that folder plus all subfolders to the path.
addpath(genpath(folder)); 

% Saving path
file_dir = what('Figures'); 
spath=file_dir.path;

% Setting
hor=10;
jhor=0:hor;
Run_color_settings
% LOAD DATA
load("Results/AR1DGP_06.mat");

% Plot
clf
figure(1);  
            hold on
            % RMSE
            p0=plot(jhor,Results.RMSE_result(:,1), '--','LineWidth',4,'Color', line_colors(1,:)); 
            p1=plot(jhor,Results.RMSE_result(:,2), '-.','LineWidth',4,'Color', line_colors(2,:)); 
            p2=plot(jhor,Results.RMSE_result(:,3), '-','LineWidth',4,'Color', line_colors(3,:)); 
            hold off; axis tight
            xlim([0 hor]);
            set(gca,'XTick',0:2:hor,'XTickLabel',cellstr(num2str((0:2:hor)')),'Layer','top','FontSize',14)
            xlabel('Horizon')  
            lh=legend([p0 p1 p2],{'VAR';'LP';'Pool'},'FontSize',16,'Location','southwest','Box','off');
            ylim([0 0.2])
            yticks(0:0.05:0.2)
            title('RMSE','FontSize',16,'FontWeight','normal')
            grid on
            ax = gca;             % Get current axes
            ax.GridLineStyle = ':';    % (Optional) Set grid line style
            ax.LineWidth = 2;         % This affects grid line thickness and axes box
            ax.GridColor = [0 0 0];
            x0=10;
            y0=10;
            width=800;
            height=500;      
            set(gcf,'position',[x0,y0,width,height])
            hold off
            saveas(figure(1),fullfile(spath,['AR_06RMSE.eps']),'epsc');
